﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using System.Collections;
using Webchatting.Common;
using Webchatting.Dal;

public partial class server_GroupCreat : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
  
    protected void btnCreatGroup_Click(object sender, EventArgs e)
    {
        Random rd = new Random();
        string GroupId = rd.Next(1000000).ToString();
        OperationGroup Ogroup = new OperationGroup();

        FormsIdentity id = (FormsIdentity)User.Identity;
        try
        {

            Ogroup.CreateGroup(GroupId, id.Ticket.UserData.Split('@')[0], txtCreateGroup.Text.Trim(), TextGroupDetails.Text.Trim());
            Ogroup.AddGroupMum(GroupId, id.Ticket.UserData.Split('@')[0], id.Ticket.UserData.Split('@')[1]);
            Response.Write("<script>alert('创建成功!');window.parent.location.href='RUIndex.aspx';</script>");

        }
        catch
        {
            Javascript.GoHistory(-1, "创建失败！", Page);
        }

       

    }
}
